/**
 * 
 */
package com.net.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;

import com.net.dao.MarkDao;
import com.net.domain.CycleTest;
import com.net.domain.MarkDetails;
import com.net.domain.Student;
import com.net.web.form.MarksForm;

/**
 * @author Dinesh
 *
 */
public class MarkServiceImpl implements MarkService {
	private MarkDao markDao;
	private StudentService studentService;
	/* (non-Javadoc)
	 * @see com.net.service.MarkService#insertMarkDetails(java.util.List)
	 */
	@Override
	public List<MarkDetails> getEligibleStudentsByGroupTest(
			MarksForm searchQuery) {
		//TODO: check input arguments
		
		List<MarkDetails> studentList = 
				markDao.getEligibleStudentsByGroupTest(searchQuery);
		
		// Convert student id to Student object
		for(MarkDetails studentMarks : studentList) {
			Student student = studentService.getStudent(studentMarks.getStudentId());
			
			studentMarks.setStudent(student);
		}
		return studentList;
	}
	@Override
	public void insertMarkDetails(List<MarkDetails> markList) {
		// TODO Auto-generated method stub
		markDao.insertMarkDetails(markList);
	}
	@Override
	public void insertTestDetails(List<MarkDetails> testList) {
		// TODO Auto-generated method stub
		markDao.insertTestDetails(testList);
	}

	/* (non-Javadoc)
	 * @see com.net.service.MarkService#deleteMarkDetails(java.util.List)
	 */

	@Override
	public void deleteMarkDetails(List<MarkDetails> markList) {
		// TODO Auto-generated method stub
		
	}
	public MarkDao getMarkDao() {
		return markDao;
	}
	@Autowired
	public void setMarkDao(MarkDao markDao) {
		this.markDao = markDao;
	}
	public StudentService getStudentService() {
		return studentService;
	}
	@Autowired
	public void setStudentService(StudentService studentService) {
		this.studentService = studentService;
	}


}
